package com.tdk.bts.util;

import java.awt.Image;

import javax.swing.ImageIcon;

public class ImageUtil {

	public static ImageIcon getImage(String name, int width, int height)
	{
		if (width == 0 || height == 0) 
		{
			return new ImageIcon(ImageUtil.class.getClassLoader().getResource("img/"+ name));
		}
		ImageIcon icon = new ImageIcon(ImageUtil.class.getClassLoader().getResource("img/"+name));
		icon.setImage(icon.getImage().getScaledInstance(width, height,Image.SCALE_DEFAULT));
		return icon;
	}
	
	public static ImageIcon getImage(String name)
	{
		return getImage(name, 0, 0);
	}

}
